package com.leyou.common.exceptions;

import com.leyou.common.enums.ExceptionEnum;
import lombok.Data;
import lombok.Getter;

/**
 * @author: guojy
 * @date: 2020/2/28 16:34
 * @Description: ${TODO}
 * @version:
 */
// 自定义异常类，继承RuntimeException,只有RuntimeException，才会被捕获
@Getter
public class LyException extends RuntimeException {
    private int status;
    private String message;

    public LyException(ExceptionEnum em) {
        this.message = em.getMessage();
        this.status = em.getStatus();
    }

    public LyException(int i, String msg) {
        this.message = msg;
        this.status = i;
    }
}
